<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1{
            width: 300px;
            height: 300px;
            background-color: #ccc;
            border: 1px solid #000;
            position: relative;
        }
        .box2{
            /*width: 300px;*/
            /*height: 100px;*/
            background-color: red;
            border: 1px solid #000;
            padding: 100px;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">自适应</div>
    </div>
</body>
</html>
